package com.example.controller;


import com.example.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wanted
 * @since 2021-11-19
 */
@CrossOrigin
@RestController
@RequestMapping("/student")
public class StudentController {
        @Autowired
        StudentService studentService;
        @RequestMapping("/list")
        public String list(){
                return studentService.list().toString();
        }

        @PostMapping(value = "/login")
        public String login(HttpServletRequest request){
                String  username = request.getParameter("username");
                String  password = request.getParameter("password");
                System.out.println(username);
                System.out.println(password);
                return "ok";
        }
}

